<template>
  <el-select v-model="value" @change="change">
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.label"
      :value="item.value"
    >
    </el-option>
  </el-select>
</template>

<script>
export default {
  name: "Link2",
  data() {
    return {
      options: [
        {
          value: "1",
          label: "水利工程系",
          link: "https://www.sdwcvc.edu.cn/slgc/",
        },
        {
          value: "2",
          label: "建筑工程系",
          link: "https://www.sdwcvc.edu.cn/jzgc/",
        },
        {
          value: "3",
          label: "资源与环境系",
          link: "https://www.sdwcvc.edu.cn/zyyhj/",
        },
        {
          value: "4",
          label: "机电工程系",
          link: "https://www.sdwcvc.edu.cn/jdgcx/",
        },
        {
          value: "5",
          label: "信息工程系",
          link: "https://www.sdwcvc.edu.cn/xxgc/",
        },
        {
          value: "6",
          label: "经济管理系",
          link: "https://www.sdwcvc.edu.cn/jjgl/",
        },
        {
          value: "7",
          label: "商务管理系",
          link: "https://www.sdwcvc.edu.cn/swglx/",
        },
        {
          value: "8",
          label: "基础教学部",
          link: "https://www.sdwcvc.edu.cn/jcjxb/",
        },
        {
          value: "9",
          label: "国际合作部",
          link: "https://www.sdwcvc.edu.cn/gjhz/",
        },
        {
          value: "10",
          label: "体育教学部",
          link: "https://www.sdwcvc.edu.cn/index.htm",
        },
      ],
      value: "- - - - -系部站点- - - - -",
    };
  },
  methods: {
    change(value) {
      let obj = {};
      obj = this.options.find((item) => {
        return item.value === value;
      });
      this.value = obj.label;
      window.location.href = obj.link;
    },
  },
};
</script>
